import java.util.Scanner;

public class a263_日期差幾天 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int y1, m1, d1;
		int y2, m2, d2;
		
		int sum_1;
		int sum_2;
		
		int different;
		
		while(sc.hasNext()) {
			y1 = sc.nextInt();
			m1 = sc.nextInt();
			d1 = sc.nextInt();
			
			sc.nextLine();
			
			y2 = sc.nextInt();
			m2 = sc.nextInt();
			d2 = sc.nextInt();

			//第一筆年月日
			sum_1 = 0;
			//年
			for(int i = 1; i <= y1 - 1; i++) {
				if(Determine(i))
					sum_1 += 366;
				else
					sum_1 += 365;
			}
			//月
			for(int i = 1; i < m1; i++) {
				if(i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10|| i == 12)
					sum_1 += 31;
				else if(i == 2) {
					if(Determine(y1)) {
						sum_1 += 29;
						continue;
					}
					sum_1 += 28;
				}
				else
					sum_1 +=30;
			}
			//日
			sum_1 += d1;
			
			//第二筆年月日
			sum_2 = 0;
			//年
			for(int i = 1; i <= y2 - 1; i++) {
				if(Determine(i))
					sum_2 += 366;
				else
					sum_2 += 365;
			}
			//月
			for(int i = 1; i < m2; i++) {
				if(i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10|| i == 12)
					sum_2 += 31;
				else if(i == 2) {
					if(Determine(y2)) {
						sum_2 +=29;
						continue;
					}
					sum_2 += 28;
				}
				else
					sum_2 +=30;
			}
			//日
			sum_2 += d2;
			
			different = Math.abs(sum_1 - sum_2);
			
			System.out.println(Integer.toString(different));
		} // next
	} // main
	
	//----------------------------------------------------------------------------------------------
	
	public static boolean Determine(int n) {
		if(n % 4 == 0 && n % 100 != 0 || n % 400 == 0)
			return true;
		return false;
	}
	
}